<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>6-构造函数回顾</title>
	</head>
	<body>
		<script type="text/javascript">
			//定义3个不同的手机对象
			var huawei = {
				brand:'华为',
				cpu:'麒麟990',
				screen:6.5
			};
			var apple = {
				brand:'苹果',
				cpu:'ios13.0',
				screen:5.9
			};
			var oppo = {
				brand:'OPPO',
				cpu:'安卓12.0',
				screen:5.7
			};
			//不能无限制创建相关对象，故需要构造函数
			function mobile(brand,cpu,screen){
				//this表示当前这个function
				this.brand = brand;
				this.cpu = cpu;
				this.screen = screen;
			}
			//通过构造函数传参，得到一个对象是m1
			var m1 = new mobile('HTC','安卓11.0',5.75);
			//HTC==安卓11.0==5.75
			console.log(m1.brand+'=='+m1.cpu+'=='+m1.screen);
				
				
			
		</script>
	</body>
</html>
